package demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext("demo7");
        //Spring默认维护类实例都是采取单例模式
       DBConnect db1= context.getBean(DBConnect.class);
        System.out.println(db1);
        DBConnect db2 =context.getBean(DBConnect.class);
        System.out.println(db2);
    }
}
